package com.smartwebx.fr.dao.mysql;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.smartwebx.fr.bean.mysql.PageUseArg;

public interface PageUseArgMapper {
	int deleteByPrimaryKey(String id);

	int insert(PageUseArg record);

	int insertSelective(PageUseArg record);

	PageUseArg selectByPrimaryKey(String id);

	int updateByPrimaryKeySelective(PageUseArg record);

	int updateByPrimaryKey(PageUseArg record);

	@Select("select * from page_use_arg where page_id = #{pageId} order by order_id")
	@ResultMap(value = "BaseResultMap")
	List<PageUseArg> getPageUseArgByPageId(@Param("pageId")Integer pageId);

	@Update("update Page_Use_Arg set order_id =#{order} where id =#{id}")
	void updateOrder(@Param("id")String id, @Param("order")Integer order);

	@Select("select max(order_id) from page_use_arg where page_id = #{pageId}")
	Integer getMaxOrderId(@Param("pageId")Integer pageId);
}